package Powerups 
{
	import Components.Sounds;
	import nl.jorisdormans.phantom2D.objects.GameObject;
	import nl.jorisdormans.phantom2D.objects.renderers.BoundingShapeRenderer;
	import nl.jorisdormans.phantom2D.objects.shapes.BoundingCircle;
	import Controllers.PowerupController;
	/**
	 * ...
	 * @author Sebastiaan
	 */
	public class GravityLow extends GameObject
	{
		public static const P_GRAVL : String = "GravLow";
		private static var object : GameObject;
		
		public function GravityLow() 
		{
			object = this;
			addComponent(new BoundingCircle(12));
			addComponent(new BoundingShapeRenderer(0x0AE214));
		}
		
		override public function afterCollisionWith(other:GameObject):void 
		{
			super.afterCollisionWith(other);
			if (other is Player)
			{
				Sounds.powerupSound.play();
				this.destroyed = true;
				this.objectLayer.screen.sendMessage(P_GRAVL);
			}
		}
		
		public static function destroy() : void
		{
			object.destroyed = true;
		}
	}
}